package com.course.web.model;

import com.course.domain.enums.TaskType;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.Min;

/**
 * Created by Justin on 2017/6/6.
 */
@Data
@EqualsAndHashCode(of = {"id"})
public class SpecWeekVM implements HasID {
    @Min(0)
    private int id;
    @Min(0)
    private int specId;
    @Min(0)
    private int partIdx;
    private String workday;
    private String weekend;
    private TaskType[] tasks;

    public TaskType getTask(int weekDay) {
        return tasks[weekDay];
    }

    public void setTask(int weekDay, TaskType type) {
        tasks[weekDay] = type;
    }
}
